<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_search
 * @copyright	Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
$lang = JFactory::getLanguage();
$upper_limit = $lang->getUpperLimitSearchWord();
?>

<div class="row-fluid">

	<div class="span12">


		<form id="searchForm" action="<?php echo JRoute::_('index.php?option=com_search');?>" method="post">
		
			<fieldset class="word">
				<label for="search-searchword">
					<?php echo JText::_('COM_SEARCH_SEARCH_KEYWORD'); ?>
				</label>
				<input type="text" name="searchword" id="search-searchword" size="30" maxlength="<?php echo $upper_limit; ?>" value="<?php echo $this->escape($this->origkeyword); ?>" class="inputbox" />
				<button name="Search" onclick="this.form.submit()" class="btn btn-success"><?php echo JText::_('COM_SEARCH_SEARCH');?></button>
				<input type="hidden" name="task" value="search" />
			</fieldset>
		
			<div class="searchintro<?php echo $this->params->get('pageclass_sfx'); ?>">
				<?php if (!empty($this->searchword)):?>
				<p><?php echo JText::plural('COM_SEARCH_SEARCH_KEYWORD_N_RESULTS', $this->total);?></p>
				<?php endif;?>
			</div>
		
			<fieldset class="phrases">
				<legend><?php echo JText::_('COM_SEARCH_FOR');?></legend>
				
					<?php echo $this->lists['searchphrase']; ?>
			
					<div class="ordering-box">
					<label for="ordering" class="checkbox inline">
						<?php echo JText::_('COM_SEARCH_ORDERING');?>
						<?php echo $this->lists['ordering'];?>
					</label>
					</div>
			</fieldset>
		
			<?php if ($this->params->get('search_areas', 1)) : ?>
				<fieldset class="only">
				<legend><?php echo JText::_('COM_SEARCH_SEARCH_ONLY');?></legend>
				<?php foreach ($this->searchareas['search'] as $val => $txt) :
					$checked = is_array($this->searchareas['active']) && in_array($val, $this->searchareas['active']) ? 'checked="checked"' : '';
				?>
				
					<label for="area-<?php echo $val;?>" class="checkbox inline">
						<?php echo JText::_($txt); ?>
						<input type="checkbox" name="areas[]" value="<?php echo $val;?>" id="area-<?php echo $val;?>" <?php echo $checked;?> />
					</label>
				<?php endforeach; ?>
				</fieldset>
			<?php endif; ?>
		
		<?php if ($this->total > 0) : ?>
		
			<div class="form-limit">
				<label for="limit">
					<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
				</label>
				<?php echo $this->pagination->getLimitBox(); ?>
			</div>
		<p class="counter">
				<?php echo $this->pagination->getPagesCounter(); ?>
			</p>
		
		<?php endif; ?>
		
		</form>	
	
	</div>

</div>


